const https = require('https')
const config = {
  hostname: 'npmjs.org',
  port: 443,
  path: '/',
  method: 'GET',
  agent: false
}
const request = https.request(config, res => {
  console.log('状态码:', res.statusCode);
  res.setEncoding('utf-8')
  res.on('data', function (drunk) {
    console.log(drunk);
  })
})
request.end()